<?php
namespace app\web\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Integral extends Validate
{
    //定义验证规则
    protected $rule = [
        'img|图片'  => 'require',
        'content|内容'  => 'require',
        'check|类型'  => 'require|number',
        'daily_secede_id|二级分类'  => 'require',
        'daily_first_id|一级分类'  => 'require',
        'type|类型'  => 'require|number',
        'first_user_id|审批人'  => 'require|number',
    ];
    //定义验证提示
    protected $message = [
        'content.require' => '请填写内容',
        'check.require' => '请选择类型',
        'check.number' => '类型格式不正确',
        'daily_secede_id.require' => '请选择福利选项',
        'daily_first_id.require' => '请选择福利选项',
        'type.require' => '请选择分数类型',
        'type.number' => '',
        'first_user_id.require' => '请填写审批人',
        'first_user_id.number' => '审批人格式不正确',
    ];
    //定义验证场景
    protected $scene = [
        'add'   =>  ['check','content','first_user_id','type','daily_secede_id','daily_first_id'],
        'save'   =>  ['evaluate','content','num','id'],
    ];
}
